{% include "default/header.html" %}
{% include "default/op_left.html" %}

<script type="text/javascript" charset="utf-8">
    window.UEDITOR_HOME_URL = "/static/js/ueditor/";
</script>

<script type="text/javascript" charset="utf-8" src="/static/js/ueditor/editor_config.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/js/ueditor/editor_all_min.js"></script>
<link rel="stylesheet" type="text/css" href="/static/js/ueditor/themes/default/ueditor.css"/>

<div id="content-block" class="col-sm-11 col-md-10">
    <div class="navbar content-navbar navbar-default navbar-xs" data-toggle="breakpoint"
        data-class-xs="navbar content-navbar navbar-inverse navbar-xs"
        data-class-sm="navbar content-navbar navbar-default navbar-xs">
        <div class="navbar-header"><button type="button" class="navbar-toggle pull-left" onclick="javascript: history.back();"><i class="icon-arrow-left"></i></button>
          <a class="navbar-brand" data-toggle="collapse" data-target="#top-nav .navbar-collapse">增加 报障 </a>
        </div>
    </div>
    <div class="form-actions well well-sm clearfix">

       <form class="form-horizontal" role="form">
				<div class="form-group">
					 <label for="inputEmail3" class="col-sm-2 control-label">故障类型</label>
					<div class="col-sm-10">
						{{ uf.fault_type }}
					</div>
				</div>
				<div class="form-group">
					 <label for="inputEmail3" class="col-sm-2 control-label">报障来源</label>
					<div class="col-sm-10">
						{{ uf.fault_type }}
					</div>
				</div>
               <div class="control-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">故障描述</label>
                    <div class="col-sm-10">
                    <input name="title" type="text" class="form-control" id="id_title" width="100"/>
                    </div>
                </div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<div class="checkbox">
							 <label><input type="checkbox" /> Remember me</label>
						</div>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						 <button type="submit" class="btn btn-default">Sign in</button>
					</div>
				</div>
			</form>









                            <form class="form-horizontal" method="post">
                    <div class="voilet_left">
                    <div class="form-group">
                                             <label class="control-label" for="name">故障类型</label>
                                            <div class="controls">
                                                    {{ uf.fault_type }}
                                            </div>
                                    </div>
                    <div class="control-group">
                                             <label class="control-label" for="name">报障来源</label>
                                            <div class="controls">
                                                    {{ uf.Source }}
                                            </div>
                                    </div>
                    <div class="control-group">
                                             <label class="control-label" for="name">故障描述</label>
                                            <div class="controls">
                                                    <input name="title" id="id_title" type="text" />
                                            </div>
                                    </div>
                    <div class="control-group">
                                             <label class="control-label" for="name">发生时间</label>
                                            <div class="controls">
                                                    <input name="Occur_date" id="id_Occur_date" type="text" />
                                            </div>
                                    </div>
                    <div class="control-group">
                                             <label class="control-label" for="name">发现时间</label>
                                            <div class="controls">
                                                    <input name="Discovery_date" id="id_Discovery_date" type="text" />
                                            </div>
                                    </div>
                    <div class="control-group">
                                             <label class="control-label" for="name">解决时间</label>
                                            <div class="controls">
                                                    <input name="Solve_date" id="id_Solve_date" type="text" />
                                            </div>
                                    </div>
                    </div>
                    <div class="voilet_right">
                    <div class="control-group">
                                             <label class="control-label"  for="name">处理过程分析</label>
                                            <div class="controls">
    {#                                                <input name="content" style="height:200px;width:400px" id="id_content" type="text" />#}
                            <textarea id="editor" name="content" style="width:auto;height:auto;"></textarea>
    {#                        {{article.content}}#}
                                            </div>
                                    </div>
    {#                <div class="control-group">#}
    {#                                         <label class="control-label" for="name">上传图片</label>#}
    {#                                        <div class="controls">#}
    {#                                                <input type="file" name="headImg" id="id_headImg" />#}
    {#                                        </div>#}
    {#                                </div>#}
    {#                {{ uf.as_p }}#}
                    </div>
                    <div class="clear"></div>
                                    <div class="control-group">
                                            <div class="controls">
                                                     <button type="submit" class="btn">提交</button>
                                            </div>
                                    </div>

                            </form>

    {#<div class="details">#}
    {#    <div>#}
    {#        <form action="/ueditor" method="post">#}
    {#            {%csrf_token%}#}
    {#            <textarea id="editor" name="editor" style="width:600px;height:500px;">{{article.content}}</textarea>#}
    {#            <input type="button" value="javascript 测试" onclick="testueditor();"/>#}
    {#            <input type="button" value="插入内容" onclick="insertueditor();"/>#}
    {#        </form>#}
    {#    </div>#}
    {#</div>#}


                    </div>
            </div>
    </div>


    {#感谢秋实同学提供js代码#}


    <script type="text/javascript">
        function calBegin(cal)
        {
            var date = cal.date;
            var field = document.getElementById("id_Occur_date");
            field.value = date.print("%Y-%m-%d %H:%M:%S");
        }
        Calendar.setup
        ({
            inputField                : "id_Occur_date",
            ifFormat                : "%Y-%m-%d %H:%M:%S",
            showsTime        : true,
            onUpdate                : calBegin
        });

        function calEnd(cal)
        {
            var date = cal.date;
            var field = document.getElementById("id_Discovery_date");
            field.value = date.print("%Y-%m-%d %H:%M:%S");
        }
        Calendar.setup
        ({
            inputField                : "id_Discovery_date",
            ifFormat                : "%Y-%m-%d %H:%M:%S",
            showsTime        : true,
            onUpdate                : calEnd
        });
        function calclose(cal)
        {
            var date = cal.date;
            var field = document.getElementById("id_Solve_date");
            field.value = date.print("%Y-%m-%d %H:%M:%S");
        }
        Calendar.setup
        ({
            inputField                : "id_Solve_date",
            ifFormat                : "%Y-%m-%d %H:%M:%S",
            showsTime        : true,
            onUpdate                : calclose
        });
    </script>

    {#end#}

    {#编缉器JS#}
    <script type="text/javascript">
        var ue=new UE.ui.Editor();
        ue.render('editor');
        ue.addListener("selectionchange",function(){
            var state = ue.queryCommandState("source");
            var btndiv = document.getElementById("btns");
            if(btndiv){
                if(state){
                    btndiv.style.display = "none";
                }else{
                    btndiv.style.display = "";
                }
            }

        });
        function getContent(){
            var arr = [];
            arr.push("使用editor.getContent()方法可以获得编辑器的内容");
            arr.push("内容为：");
            arr.push(ue.getContent());
            alert(arr.join("\n"));
        }
        function getPlainTxt(){
            var arr = [];
            arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容");
            arr.push("内容为：");
            arr.push(ue.getPlainTxt());
            alert(arr.join('\n'))
        }
        function setContent(){
            var arr = [];
            arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容");
            ue.setContent('欢迎使用ueditor');
            alert(arr.join("\n"));
        }

        function getText(){
            //当你点击按钮时编辑区域已经失去了焦点，如果直接用getText将不会得到内容，所以要在选回来，然后取得内容
            var range = ue.selection.getRange();
            range.select();
            var txt = ue.selection.getText();
            alert(txt)
        }

        function testueditor(){
                mycontent=ue.getContentTxt();
                alert(mycontent);
        }

        function insertueditor(){
                ue.execCommand('insertHtml',"自定义插件，我的名片        ");
        }

        function getContentTxt(){
            var arr = [];
            arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");
            arr.push("编辑器的纯文本内容为：");
            arr.push(ue.getContentTxt());
            alert(arr.join("\n"));
        }
        function hasContent(){
            var arr = [];
            arr.push("使用editor.hasContents()方法判断编辑器里是否有内容");
            arr.push("判断结果为：");
            arr.push(ue.hasContents());
            alert(arr.join("\n"));
        }
        function setFocus(){
            ue.focus();

        }
        function deleteEditor(){
            var div = document.getElementById('allbtn');
            var btns = baidu.editor.dom.domUtils.getElementsByTagName(div,"a");
            for(var i=0,btn;btn=btns[i++];){
                        btn.style.cssText = "color:#ccc;text-decoration:none;cursor:default";
                btn.onclick = function(){
                    return false;
                };
            }
            ue.destroy();
        }
            function setEnabled(){
                var div = document.getElementById('allbtn');
            var btns = baidu.editor.dom.domUtils.getElementsByTagName(div,"a");
            for(var i=0,btn;btn=btns[i++];){
                            btn.style.cssText = "color:#3E3E3E;text-decoration:none;cursor:pointer";
            }
                ue.setEnabled();
            }
            function setDisable(){
                var div = document.getElementById('allbtn');
            var btns = baidu.editor.dom.domUtils.getElementsByTagName(div,"a");
            for(var i=0,btn;btn=btns[i++];){
                        if(btn.innerHTML != "可以编辑"){
                                    btn.style.cssText = "color:#ccc;text-decoration:none;cursor:default";
                            }
            }
                ue.setDisabled("fullscreen");
            }

    </script>

    <!-- baidu ueditor end -->




    </div>
</div>
 {% include "default/footer.html" %}